package com.gcxy.springmybatisplustest.converter;

import org.springframework.core.convert.converter.Converter;
import org.springframework.util.ObjectUtils;

public class StringToOrderConverter implements Converter<Integer, String> {

    @Override
    public String convert(Integer source) {
        if (!ObjectUtils.isEmpty(source)){
            if (source == 0){
                return "待支付";
            }
            if (source == 1){
                return "已支付";
            }
            if (source == 2){
                return "已发货";
            }
            if (source == 3){
                return "已完成";
            }
        }
        return null;
    }
}
